unit EstoqueConsumoFr;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  ComCtrls, ExtCtrls, StdCtrls, Buttons, DbCtrls, DBGrids, EditBtn, EstoqueFr;

type

  { TEstoqueConsumoFrame }

  TEstoqueConsumoFrame = class(TEstoqueMainFrame)
    dataInicioEdit: TDateEdit;
    dataFimEdit: TDateEdit;
    DBGrid1: TDBGrid;
    DBGrid2: TDBGrid;
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    MostrarDescBtn: TBitBtn;
    Panel1: TPanel;
    Panel2: TPanel;
    Panel3: TPanel;
    ProdutoEdit: TEdit;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    procedure MostrarDescBtnClick(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

implementation

uses ProdutoDM;

{ TEstoqueConsumoFrame }

procedure TEstoqueConsumoFrame.MostrarDescBtnClick(Sender: TObject);
begin
  if (dataInicioEdit.Text = '') or (dataFimEdit.Text = '') then begin
    ShowMessage('Selecione uma Data');
  end else if ProdutoEdit.Text = '' then begin
      ProdutoData.BuscaDataConsumo(dataInicioEdit.Text,dataFimEdit.Text);
  end else begin
      ProdutoData.BuscaDataConsumoProduto(dataInicioEdit.Text,dataFimEdit.Text,ProdutoEdit.Text);
  end;
end;

procedure TEstoqueConsumoFrame.SpeedButton1Click(Sender: TObject);
begin
  //!Fazer imprimir
end;

procedure TEstoqueConsumoFrame.SpeedButton2Click(Sender: TObject);
begin

end;

initialization
  {$I estoqueconsumofr.lrs}

end.

